<template>
    <div class="page-header" v-if="showPageHeader">
        <el-page-header @back="goBack" title="返回" :content="pageTitle">
        </el-page-header>
        <el-divider border-style="dotted"></el-divider>
    </div>
    
</template>
<script setup lang="ts">
import { ref, watch ,computed} from 'vue'
import { useRoute, useRouter } from 'vue-router'
const router = useRouter()
const route= useRoute()

const pageTitle=ref<any>('')
const showPageHeader=computed(()=>{
    return route.path !=="/"
})
watch(route , (newValue,oldValue) => {
    pageTitle.value=newValue.meta?.title 
})
const goBack=()=>{
    router.go(-1)
}

</script>
<style scoped>
.el-divider--horizontal {
    margin: 12px 0;
}
</style>